
public class Board {
	private Piece[][] board;
	private int board_dimension;
	
	public Board(int board_dimension){
		this.board = new Piece[board_dimension][board_dimension];
		this.board_dimension = board_dimension;
	}
	
	public void setPiece(int row, int col, Piece piece){
		this.board[row][col] = piece;
	}
	
	public Board clone(){
		Board newBoard = new Board(board_dimension);
		
		for (int i=0;i<board_dimension;i++){
			for (int j=0;j<board_dimension;j++){
				if (board[i][j]!=null){
					newBoard.setPiece(i,j,board[i][j]);
				}
			}
		}
		
		return newBoard; 
	}
	
	public boolean hasPiece(int row, int col){
		return board[row][col]!=null;
	}
	
	public boolean isColor(int row, int col, char color){
		if (board[row][col]!=null && board[row][col].getColor()==color){
			return true;
		}
		return false;
	}
	
	public boolean isCharacter(int row, int col, char character){
		if (board[row][col]!=null && board[row][col].getCharacter()==character){
			return true;
		}
		return false;
	}
	
	public Piece pieceAt(int row, int col){
		return board[row][col];
	}
	
	public void removePiece(int row, int col){
		board[row][col]=null;
	}
}
